package com.cn.ycy.transaction;

import com.cn.ycy.CompentScanConfig;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


public class TransactionTest {

    JdbcTempleteServiceImpl bean;

    @Before
    public void Before() {
        AnnotationConfigApplicationContext annotationConfigApplicationContext =
                new AnnotationConfigApplicationContext(CompentScanConfig.class);
        // 演示事务的传播性质
        bean = annotationConfigApplicationContext.getBean(JdbcTempleteServiceImpl.class);
    }

    @Test
    public void test0() {
        bean.noTransaction();
    }

    @Test
    public void test00() {
        bean.startTransaction();
    }

    @Test
    public void test1() {
        bean.insert();
    }

    @Test
    public void test2() {
        bean.insertCreateNewTransation();
    }

    @Test
    public void test3() {
        bean.insert16();
    }

    @Test
    public void test12() {
        bean.insert12();
    }

}
